<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 statistics.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.1
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
include $root_path.'common.php';
$page_title = $lang['statistics'];
include $root_path.'page_header.php';


$template->set_filenames(array(
	'body' => $root_path.$template_path.'stats/statistics.tpl')
);


$is_analog_installed = <<<EOF
<cpanelif !$CONF{'skipanalog'} $CPDATA{'FEATURE-ANALOG'}><cpanelfeature analog>test</cpanelfeature></cpanelif>
EOF;

if (!empty($is_analog_installed)) {
	$template->assign_block_vars('switch_analog', array());
}

$is_awstats_installed = <<<EOF
<cpanelif !$CONF{'skipawstats'} $CPDATA{'FEATURE-AWSTATS'}><cpanelfeature awstats>test</cpanelfeature></cpanelif>
EOF;

if (!empty($is_awstats_installed)) {
	$template->assign_block_vars('switch_awstats', array());
}

$is_webalizer_installed = <<<EOF
<cpanelif !$CONF{'skipwebalizer'} $CPDATA{'FEATURE-WEBALIZER'}><cpanelfeature webalizer>test</cpanelfeature></cpanelif>
EOF;

if (!empty($is_webalizer_installed)) {
	$template->assign_block_vars('switch_webalizer', array());
}

$is_urchin_installed = <<<EOF
<cpanelif $hasurchin>test</cpanelif>
EOF;

if (!empty($is_urchin_installed)) {
	$template->assign_block_vars('switch_urchin', array());
}

$u_webalizer_ftp = <<<EOFpacman
<cpanel Stats="webalizerftp($CPDATA{'DNS'})">
EOFpacman;

$template->assign_vars(array(
	'U_ANALOG' => 'analog.php?domain='.$domain,
	'U_AWSTATS' => '<cpanel Stats="awstats($CPDATA{'DNS'})">',
	'U_WEBALIZER' => '<cpanel Stats="webalizer($CPDATA{'DNS'})">',
	'U_WEBALIZER_FTP' => $u_webalizer_ftp,
	'U_URCHIN' => 'urchin.cgi',
	
	'L_STATISTICS' => $lang['statistics'],
	'L_ANALOG' => $lang['analog'],
	'L_ANALOG_INFO' => $lang['analog_info'],
	'L_AWSTATS' => $lang['awstats'],
	'L_AWSTATS_INFO' => $lang['awstats_info'],
	'L_URCHIN' => $lang['urchin'],
	'L_URCHIN_INFO' => $lang['urchin_info'],
	'L_WEBALIZER' => $lang['webalizer'],
	'L_WEBALIZER_INFO' => sprintf($lang['webalizer_info'], $u_webalizer_ftp), 
));




//
// Woohoo! All done!
//
$template->pparse('body');

include $root_path.'page_tail.php';


?>